#!/bin/bash

DB_NAME=${1:-new_taisan}
OUT_PUT=${2:-$DB_NAME.html}

tables="$(echo show tables | mysql --skip-column-names $DB_NAME)"

# echo "$tables" > $OUT_PUT
for table in $tables ; do
	echo "<a id='a_$table' href='#$table'>$table</a><br>"
done > $OUT_PUT
echo '<hr>' >> $OUT_PUT
for table in $tables ; do
	echo "<a id='$table' href='#a_$table'>$table</a><br>"
	echo desc $table | mysql --html $DB_NAME
done >> $OUT_PUT
